package  
{
	import flash.media.Sound;
	import flash.media.SoundChannel;
	import flash.utils.Dictionary;
	/**
	 * ...
	 * @author Seven Gae
	 */
	public class SoundManager 
	{
		public static var soundDictionary: Dictionary = new Dictionary();
		public static var soundChannelDictionary: Dictionary = new Dictionary();
		
		private static var soundChannel: SoundChannel = new SoundChannel();
		
		public static function addSound(sound: Sound, soundName: String):void
		{
			soundDictionary[soundName] = sound;
			soundChannelDictionary[soundName] = new SoundChannel();
		}
		
		public static function playSound(soundName:String):void
		{
			soundChannelDictionary[soundName] = soundDictionary[soundName].play();
		}
		
		public static function playLoopedSound(soundName:String):void
		{
			soundChannelDictionary[soundName] = soundDictionary[soundName].play(0, 999999999);
		}
	
		public static function stopSound(soundName:String):void
		{
			soundChannelDictionary[soundName].stop();
		}
		
	}

}